<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OrangeCNC - ARISC firmware documentation: io.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OrangeCNC - ARISC firmware documentation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('io_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">io.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="io_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __IO_H__</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __IO_H__</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div><div class="line"><a name="l00006"></a><span class="lineno"><a class="line" href="io_8h.html#aed54ef84775a6b4184dbc8a5cfdce6eb">    6</a></span>&#160;<span class="preprocessor">#define readl(addr)         (*((volatile uint32_t *)(addr)))</span></div><div class="line"><a name="l00007"></a><span class="lineno"><a class="line" href="io_8h.html#ab90b1d3d9044f8445e52de3289a02342">    7</a></span>&#160;<span class="preprocessor">#define writel(v, addr)     (readl(addr) = (uint32_t)(v))</span></div><div class="line"><a name="l00008"></a><span class="lineno"><a class="line" href="io_8h.html#aa1092889a966f906260044e4291f4fce">    8</a></span>&#160;<span class="preprocessor">#define set_bit(nr, addr)   (readl(addr) |=  (1u &lt;&lt; (nr)))</span></div><div class="line"><a name="l00009"></a><span class="lineno"><a class="line" href="io_8h.html#adbf4e1afa46bb31a1287930b97daf0a7">    9</a></span>&#160;<span class="preprocessor">#define clr_bit(nr, addr)   (readl(addr) &amp;= ~(1u &lt;&lt; (nr)))</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="io_8h.html#a4eaf4bf81c52c3f375967906e4d5ba17">   11</a></span>&#160;<span class="preprocessor">#define BIT(nr)             (1u &lt;&lt; (nr))</span></div><div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="io_8h.html#a58036ec108bbebb24caf8258cc569e36">   12</a></span>&#160;<span class="preprocessor">#define MASK(nr)            ((1u &lt;&lt; (nr)) - 1)</span></div><div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="io_8h.html#ad8da9194ea08031aae97a6e6ecc421d7">   13</a></span>&#160;<span class="preprocessor">#define MASK_AT(nr, start)  (MASK(nr) &lt;&lt; (start))</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="io_8h.html#a9924ce77c6ee520262d95cb9e0c91e75">   15</a></span>&#160;<span class="preprocessor">#define GET_BITS_AT(value, nr, start)       (((value) &gt;&gt; start) &amp; MASK(nr))</span></div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="io_8h.html#a8ee4771e564336128cbd231b58ec81bd">   16</a></span>&#160;<span class="preprocessor">#define SET_BITS_AT(value, nr, start, bits) ((value) &amp;= ~MASK_AT(nr, start), (value) |= ((bits) &amp; MASK(nr)) &lt;&lt; start)</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#endif</span></div></div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="io_8h.html">io.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
